package com.leijie.proto;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.29.0)",
    comments = "Source: Persion.proto")
public final class PersionServiceGrpc {

  private PersionServiceGrpc() {}

  public static final String SERVICE_NAME = "com.leijie.protobuf.PersionService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.leijie.proto.MyRequest,
      com.leijie.proto.MyResponse> getGetRealNameByUsernameMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetRealNameByUsername",
      requestType = com.leijie.proto.MyRequest.class,
      responseType = com.leijie.proto.MyResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.leijie.proto.MyRequest,
      com.leijie.proto.MyResponse> getGetRealNameByUsernameMethod() {
    io.grpc.MethodDescriptor<com.leijie.proto.MyRequest, com.leijie.proto.MyResponse> getGetRealNameByUsernameMethod;
    if ((getGetRealNameByUsernameMethod = PersionServiceGrpc.getGetRealNameByUsernameMethod) == null) {
      synchronized (PersionServiceGrpc.class) {
        if ((getGetRealNameByUsernameMethod = PersionServiceGrpc.getGetRealNameByUsernameMethod) == null) {
          PersionServiceGrpc.getGetRealNameByUsernameMethod = getGetRealNameByUsernameMethod =
              io.grpc.MethodDescriptor.<com.leijie.proto.MyRequest, com.leijie.proto.MyResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRealNameByUsername"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.MyRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.MyResponse.getDefaultInstance()))
              .setSchemaDescriptor(new PersionServiceMethodDescriptorSupplier("GetRealNameByUsername"))
              .build();
        }
      }
    }
    return getGetRealNameByUsernameMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest,
      com.leijie.proto.StreamResponse> getGetPersionByAgeMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getPersionByAge",
      requestType = com.leijie.proto.StreamRequest.class,
      responseType = com.leijie.proto.StreamResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest,
      com.leijie.proto.StreamResponse> getGetPersionByAgeMethod() {
    io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest, com.leijie.proto.StreamResponse> getGetPersionByAgeMethod;
    if ((getGetPersionByAgeMethod = PersionServiceGrpc.getGetPersionByAgeMethod) == null) {
      synchronized (PersionServiceGrpc.class) {
        if ((getGetPersionByAgeMethod = PersionServiceGrpc.getGetPersionByAgeMethod) == null) {
          PersionServiceGrpc.getGetPersionByAgeMethod = getGetPersionByAgeMethod =
              io.grpc.MethodDescriptor.<com.leijie.proto.StreamRequest, com.leijie.proto.StreamResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getPersionByAge"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.StreamRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.StreamResponse.getDefaultInstance()))
              .setSchemaDescriptor(new PersionServiceMethodDescriptorSupplier("getPersionByAge"))
              .build();
        }
      }
    }
    return getGetPersionByAgeMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest,
      com.leijie.proto.ListResponse> getGetPersionWrapperByAgesMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getPersionWrapperByAges",
      requestType = com.leijie.proto.StreamRequest.class,
      responseType = com.leijie.proto.ListResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest,
      com.leijie.proto.ListResponse> getGetPersionWrapperByAgesMethod() {
    io.grpc.MethodDescriptor<com.leijie.proto.StreamRequest, com.leijie.proto.ListResponse> getGetPersionWrapperByAgesMethod;
    if ((getGetPersionWrapperByAgesMethod = PersionServiceGrpc.getGetPersionWrapperByAgesMethod) == null) {
      synchronized (PersionServiceGrpc.class) {
        if ((getGetPersionWrapperByAgesMethod = PersionServiceGrpc.getGetPersionWrapperByAgesMethod) == null) {
          PersionServiceGrpc.getGetPersionWrapperByAgesMethod = getGetPersionWrapperByAgesMethod =
              io.grpc.MethodDescriptor.<com.leijie.proto.StreamRequest, com.leijie.proto.ListResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getPersionWrapperByAges"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.StreamRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.ListResponse.getDefaultInstance()))
              .setSchemaDescriptor(new PersionServiceMethodDescriptorSupplier("getPersionWrapperByAges"))
              .build();
        }
      }
    }
    return getGetPersionWrapperByAgesMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.leijie.proto.StrRequest,
      com.leijie.proto.StrResponse> getBiTalkMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "BiTalk",
      requestType = com.leijie.proto.StrRequest.class,
      responseType = com.leijie.proto.StrResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.leijie.proto.StrRequest,
      com.leijie.proto.StrResponse> getBiTalkMethod() {
    io.grpc.MethodDescriptor<com.leijie.proto.StrRequest, com.leijie.proto.StrResponse> getBiTalkMethod;
    if ((getBiTalkMethod = PersionServiceGrpc.getBiTalkMethod) == null) {
      synchronized (PersionServiceGrpc.class) {
        if ((getBiTalkMethod = PersionServiceGrpc.getBiTalkMethod) == null) {
          PersionServiceGrpc.getBiTalkMethod = getBiTalkMethod =
              io.grpc.MethodDescriptor.<com.leijie.proto.StrRequest, com.leijie.proto.StrResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "BiTalk"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.StrRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.leijie.proto.StrResponse.getDefaultInstance()))
              .setSchemaDescriptor(new PersionServiceMethodDescriptorSupplier("BiTalk"))
              .build();
        }
      }
    }
    return getBiTalkMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static PersionServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<PersionServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<PersionServiceStub>() {
        @java.lang.Override
        public PersionServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new PersionServiceStub(channel, callOptions);
        }
      };
    return PersionServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static PersionServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<PersionServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<PersionServiceBlockingStub>() {
        @java.lang.Override
        public PersionServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new PersionServiceBlockingStub(channel, callOptions);
        }
      };
    return PersionServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static PersionServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<PersionServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<PersionServiceFutureStub>() {
        @java.lang.Override
        public PersionServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new PersionServiceFutureStub(channel, callOptions);
        }
      };
    return PersionServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class PersionServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void getRealNameByUsername(com.leijie.proto.MyRequest request,
        io.grpc.stub.StreamObserver<com.leijie.proto.MyResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getGetRealNameByUsernameMethod(), responseObserver);
    }

    /**
     * <pre>
     *返回流式结果
     * </pre>
     */
    public void getPersionByAge(com.leijie.proto.StreamRequest request,
        io.grpc.stub.StreamObserver<com.leijie.proto.StreamResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getGetPersionByAgeMethod(), responseObserver);
    }

    /**
     * <pre>
     *流式 返回list
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.leijie.proto.StreamRequest> getPersionWrapperByAges(
        io.grpc.stub.StreamObserver<com.leijie.proto.ListResponse> responseObserver) {
      return asyncUnimplementedStreamingCall(getGetPersionWrapperByAgesMethod(), responseObserver);
    }

    /**
     * <pre>
     *双向流式数据传递
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.leijie.proto.StrRequest> biTalk(
        io.grpc.stub.StreamObserver<com.leijie.proto.StrResponse> responseObserver) {
      return asyncUnimplementedStreamingCall(getBiTalkMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGetRealNameByUsernameMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.leijie.proto.MyRequest,
                com.leijie.proto.MyResponse>(
                  this, METHODID_GET_REAL_NAME_BY_USERNAME)))
          .addMethod(
            getGetPersionByAgeMethod(),
            asyncServerStreamingCall(
              new MethodHandlers<
                com.leijie.proto.StreamRequest,
                com.leijie.proto.StreamResponse>(
                  this, METHODID_GET_PERSION_BY_AGE)))
          .addMethod(
            getGetPersionWrapperByAgesMethod(),
            asyncClientStreamingCall(
              new MethodHandlers<
                com.leijie.proto.StreamRequest,
                com.leijie.proto.ListResponse>(
                  this, METHODID_GET_PERSION_WRAPPER_BY_AGES)))
          .addMethod(
            getBiTalkMethod(),
            asyncBidiStreamingCall(
              new MethodHandlers<
                com.leijie.proto.StrRequest,
                com.leijie.proto.StrResponse>(
                  this, METHODID_BI_TALK)))
          .build();
    }
  }

  /**
   */
  public static final class PersionServiceStub extends io.grpc.stub.AbstractAsyncStub<PersionServiceStub> {
    private PersionServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected PersionServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new PersionServiceStub(channel, callOptions);
    }

    /**
     */
    public void getRealNameByUsername(com.leijie.proto.MyRequest request,
        io.grpc.stub.StreamObserver<com.leijie.proto.MyResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getGetRealNameByUsernameMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *返回流式结果
     * </pre>
     */
    public void getPersionByAge(com.leijie.proto.StreamRequest request,
        io.grpc.stub.StreamObserver<com.leijie.proto.StreamResponse> responseObserver) {
      asyncServerStreamingCall(
          getChannel().newCall(getGetPersionByAgeMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *流式 返回list
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.leijie.proto.StreamRequest> getPersionWrapperByAges(
        io.grpc.stub.StreamObserver<com.leijie.proto.ListResponse> responseObserver) {
      return asyncClientStreamingCall(
          getChannel().newCall(getGetPersionWrapperByAgesMethod(), getCallOptions()), responseObserver);
    }

    /**
     * <pre>
     *双向流式数据传递
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.leijie.proto.StrRequest> biTalk(
        io.grpc.stub.StreamObserver<com.leijie.proto.StrResponse> responseObserver) {
      return asyncBidiStreamingCall(
          getChannel().newCall(getBiTalkMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class PersionServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<PersionServiceBlockingStub> {
    private PersionServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected PersionServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new PersionServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.leijie.proto.MyResponse getRealNameByUsername(com.leijie.proto.MyRequest request) {
      return blockingUnaryCall(
          getChannel(), getGetRealNameByUsernameMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     *返回流式结果
     * </pre>
     */
    public java.util.Iterator<com.leijie.proto.StreamResponse> getPersionByAge(
        com.leijie.proto.StreamRequest request) {
      return blockingServerStreamingCall(
          getChannel(), getGetPersionByAgeMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class PersionServiceFutureStub extends io.grpc.stub.AbstractFutureStub<PersionServiceFutureStub> {
    private PersionServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected PersionServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new PersionServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.leijie.proto.MyResponse> getRealNameByUsername(
        com.leijie.proto.MyRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getGetRealNameByUsernameMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_REAL_NAME_BY_USERNAME = 0;
  private static final int METHODID_GET_PERSION_BY_AGE = 1;
  private static final int METHODID_GET_PERSION_WRAPPER_BY_AGES = 2;
  private static final int METHODID_BI_TALK = 3;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final PersionServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(PersionServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_REAL_NAME_BY_USERNAME:
          serviceImpl.getRealNameByUsername((com.leijie.proto.MyRequest) request,
              (io.grpc.stub.StreamObserver<com.leijie.proto.MyResponse>) responseObserver);
          break;
        case METHODID_GET_PERSION_BY_AGE:
          serviceImpl.getPersionByAge((com.leijie.proto.StreamRequest) request,
              (io.grpc.stub.StreamObserver<com.leijie.proto.StreamResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_PERSION_WRAPPER_BY_AGES:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getPersionWrapperByAges(
              (io.grpc.stub.StreamObserver<com.leijie.proto.ListResponse>) responseObserver);
        case METHODID_BI_TALK:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.biTalk(
              (io.grpc.stub.StreamObserver<com.leijie.proto.StrResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class PersionServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    PersionServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.leijie.proto.Persion.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("PersionService");
    }
  }

  private static final class PersionServiceFileDescriptorSupplier
      extends PersionServiceBaseDescriptorSupplier {
    PersionServiceFileDescriptorSupplier() {}
  }

  private static final class PersionServiceMethodDescriptorSupplier
      extends PersionServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    PersionServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (PersionServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new PersionServiceFileDescriptorSupplier())
              .addMethod(getGetRealNameByUsernameMethod())
              .addMethod(getGetPersionByAgeMethod())
              .addMethod(getGetPersionWrapperByAgesMethod())
              .addMethod(getBiTalkMethod())
              .build();
        }
      }
    }
    return result;
  }
}
